package com.ruoyi.project.system.mapper;

import java.util.List;

import com.ruoyi.project.system.domain.SafetyHazardRecord;
import org.apache.ibatis.annotations.Mapper;
import org.apache.ibatis.annotations.Param;
import org.apache.ibatis.annotations.Select;
import org.springframework.security.core.parameters.P;

/**
 * 安全风险记录Mapper接口
 * 
 * @author ruoyi
 * @date 2020-10-07
 */
@Mapper
public interface SafetyHazardRecordMapper 
{
    /**
     * 查询安全风险记录
     * 
     * @param id 安全风险记录ID
     * @return 安全风险记录
     */
    public SafetyHazardRecord selectSafetyHazardRecordById(Integer id);

    /**
     * 查询安全风险记录列表
     * 
     * @param safetyHazardRecord 安全风险记录
     * @return 安全风险记录集合
     */
    public List<SafetyHazardRecord> selectSafetyHazardRecordList(SafetyHazardRecord safetyHazardRecord);

    /**
     * 新增安全风险记录
     * 
     * @param safetyHazardRecord 安全风险记录
     * @return 结果
     */
    public int insertSafetyHazardRecord(SafetyHazardRecord safetyHazardRecord);

    /**
     * 修改安全风险记录
     * 
     * @param safetyHazardRecord 安全风险记录
     * @return 结果
     */
    public int updateSafetyHazardRecord(SafetyHazardRecord safetyHazardRecord);

    /**
     * 删除安全风险记录
     * 
     * @param id 安全风险记录ID
     * @return 结果
     */
    public int deleteSafetyHazardRecordById(Integer id);

    /**
     * 批量删除安全风险记录
     * 
     * @param ids 需要删除的数据ID
     * @return 结果
     */
    public int deleteSafetyHazardRecordByIds(Integer[] ids);


    @Select("select count(*) from safety_hazard_record where state=#{state}")
    int selectList(@Param("state") Integer state);

    @Select("select count(*) from safety_hazard_record where state=#{state} and college_id=#{college_id}")
    int selectThList(@Param("college_id") Long college_id,@Param("state") Integer state);
}
